package com.ptmall.app.net.base;

import com.google.gson.annotations.SerializedName;

/**
 * Created by Administrator on 2018/1/20.
 * 接口请求结果通用格式类
 */

public class ApiBaseData {


    private int statusCode;

    @SerializedName("msg")
    private String message;

    private Object data;

    @SerializedName("error")
    private int code;

    /**
     * 标示 是否是 下载--便于判断 进度
     */
    private boolean isDownload = false;


    public boolean isSuccess() {
        if (code == 0) {
            return true;
        } else {
            return false;
        }
    }

    public String getInfo() {
        return message;
    }

    public void setInfo(String info) {
        this.message = info;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public int getStatus() {
        return code;
    }

    public void setStatus(int status) {
        this.code = status;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }

    public boolean isDownload() {
        return isDownload;
    }

    public void setDownload(boolean download) {
        isDownload = download;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
